import turtle

# 设置画布和画笔
screen = turtle.Screen()
screen.title("笑脸")
pen = turtle.Turtle()
pen.speed(3)  # 设置绘制速度（1最慢，10最快）
pen.pensize(3)  # 设置画笔粗细

# 绘制脸（黄色圆形）
pen.begin_fill()
pen.color("yellow")
pen.circle(100)  # 半径100的圆
pen.end_fill()

# 绘制左眼
pen.penup()  # 抬起画笔，不绘制
pen.goto(-40, 120)  # 移动到左眼位置
pen.pendown()  # 放下画笔，开始绘制
pen.begin_fill()
pen.color("black")
pen.circle(15)  # 左眼
pen.end_fill()

# 绘制右眼
pen.penup()
pen.goto(40, 120)  # 移动到右眼位置
pen.pendown()
pen.begin_fill()
pen.circle(15)  # 右眼
pen.end_fill()

# 绘制微笑的嘴巴
pen.penup()
pen.goto(-60, 60)  # 移动到嘴巴起始位置
pen.pendown()
pen.color("black")
pen.setheading(-60)  # 设置画笔方向
pen.circle(70, 120)  # 绘制弧线作为嘴巴

# 隐藏画笔
pen.hideturtle()

# 保持窗口打开
screen.mainloop()
